package com.ruoyi.student.api.factory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.student.api.ClassService;
import com.ruoyi.student.domain.TClass;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ClassServicefallbackFactory implements FallbackFactory<ClassService> {
    @Override
    public ClassService create(Throwable cause) {
        return new ClassService() {
            @Override
            public AjaxResult getInfo(Long id) {
                return AjaxResult.error(-1, "网络延迟，请稍后再试");
            }

            @Override
            public List<TClass> listClass() {
                return null;
            }

        };
    }
}
